#!/bin/bash

# 进入工作空间目录
cd ~/shangweiji
source devel/setup.bash

repos=(
    "robot_app"
    "robot_map"
    "robot_auto_drill"
)

# 启动每个节点在新的终端窗口
for repo in "${repos[@]}"; do
    if [ "$repo" == "robot_app" ]; then
        # 使用 roslaunch 启动 robot_app
        gnome-terminal -- bash -c "source ~/shangweiji/devel/setup.bash && roslaunch $repo ${repo}.launch; exec bash"
    else
        # 其他包使用 rosrun 启动
        gnome-terminal -- bash -c "source ~/shangweiji/devel/setup.bash && rosrun $repo ${repo}_node; exec bash"
    fi
done

echo "All nodes launched in separate terminals!"

